package com.game.framework.dao;

import com.game.framework.dao.entity.FishPoleEntity;
import com.game.framework.dao.redis.EnumRedisKey;
import com.game.framework.dao.redis.IRedisKeyConfig;
import com.game.framework.dao.repository.FishPoleRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.mongodb.repository.MongoRepository;
import org.springframework.stereotype.Service;

import java.util.Optional;

@Service
public class FishPoleDao extends AbstractDao<FishPoleEntity, Long>{

	@Autowired
	protected FishPoleRepository fishPoleRepository;
	
	@Override
	protected IRedisKeyConfig getRedisKey() {
		return EnumRedisKey.FishPoleInfo;
	}

	@Override
	protected MongoRepository<FishPoleEntity, Long> getMongoRepository() {
		return fishPoleRepository;
	}

	@Override
	protected Class<FishPoleEntity> getEntityClass() {
		return FishPoleEntity.class;
	}

	Optional<FishPoleEntity> findById(Long id){
		return fishPoleRepository.findById(id);
	}
}
